package com.fit.entities.studentOfTheCourse;

import java.io.Serializable;

import javax.persistence.Embeddable;
import javax.persistence.ManyToOne;

import com.fit.entities.course.Course;
import com.fit.entities.student.Student;
import com.fit.entities.user.User;

@Embeddable
public class StudentOfTheCoursePk implements Serializable {

	@ManyToOne
	private User user;
	@ManyToOne
	private Course course;

	

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Course getCourse() {
		return course;
	}

	public void setCourse(Course course) {
		this.course = course;
	}

	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;

		StudentOfTheCoursePk that = (StudentOfTheCoursePk) o;

		if (course != null ? !course.equals(that.course) : that.course != null)
			return false;
		if (user != null ? !user.equals(that.user)
				: that.user != null)
			return false;

		return true;
	}
}
